home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / toolboxsas.lha / Toolbox / lib / include / System.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  2.3 KB  |  88 lines

  1. #ifndef yySystem
  2. #define yySystem
  3.  
  4. /* $Id: System.h,v 1.3 1992/02/04 14:01:39 grosch rel $ */
  5.  
  6. /* $Log:
  7.  */
  8.  
  9. /* Ich, Doktor Josef Grosch, Informatiker, Jan. 1992 */
  10.  
  11.  
  12. /* interface for machine dependencies */
  13.  
  14. #ifndef bool
  15.   #define bool char
  16. #endif
  17. #define tFile int
  18.  
  19.  
  20. /* binary IO */
  21.  
  22. tFile OpenInput(char *FileName);
  23. /* Opens the file whose name is given by the */
  24. /* string parameter 'FileName' for input.    */
  25. /* Returns an integer file descriptor.       */
  26.  
  27. tFile OpenOutput(char *FileName);
  28. /* Opens the file whose name is given by the */
  29. /* string parameter 'FileName' for output.   */
  30. /* Returns an integer file descriptor.       */
  31.  
  32. int Read(tFile File, char *Buffer, int Size);
  33. /* Reads 'Size' bytes from file 'tFile' and    */
  34. /* stores them in a buffer starting at address */
  35. /* 'Buffer'.                                   */
  36. /* Returns the number of bytes actually read.  */
  37.  
  38. int Write(tFile File, char *Buffer, int Size);
  39. /* Writes 'Size' bytes from a buffer starting    */
  40. /* at address 'Buffer' to file 'tFile'.          */
  41. /* Returns the number of bytes actually written. */
  42.  
  43. void Close(tFile File);
  44. /* Closes file 'tFile'. */
  45.  
  46. bool IsCharacterSpecial(tFile File);
  47. /* Returns TRUE when file 'tFile' is connected */
  48. /* to a character device like a terminal.      */
  49.  
  50.  
  51. /* calls other than IO */
  52.  
  53. char *SysAlloc(long ByteCount);
  54. /* Returns a pointer to dynamically allocated */
  55. /* memory space of size 'ByteCount' bytes.    */
  56. /* Returns NIL if space is exhausted.         */
  57.  
  58. long Time(void);
  59. /* Returns consumed cpu-time in milliseconds. */
  60.  
  61. int GetArgCount(void);
  62. /* Returns number of arguments. */
  63.  
  64. void GetArgument(int ArgNum, char *Argument);
  65. /* Stores a string-valued argument whose index */
  66. /* is 'ArgNum' in the memory area 'Argument'.  */
  67.  
  68. void PutArgs(int Argc, char **Argv);
  69. /* Dummy procedure that passes the values */
  70. /* 'argc' and 'argv' from Modula-2 to C.  */
  71.  
  72. int ErrNum(void);
  73. /* Returns the current system error code. */
  74.  
  75. int System(char *String);
  76. /* Executes an operating system command given */
  77. /* as the string 'String'. Returns an exit or */
  78. /* return code.                               */
  79.  
  80. void Exit(int Status);
  81. /* Terminates program execution and passes the */
  82. /* value 'Status' to the operating system.     */
  83.  
  84. void BEGIN_System(void);
  85. /* Dummy procedure with empty body. */
  86.  
  87. #endif
  88.